<template>
  <div>
    <el-radio-group v-model="isCollapse" style="margin-bottom: 20px">
      <el-radio-button :label="false">expand</el-radio-button>
      <el-radio-button :label="true">collapse</el-radio-button>
    </el-radio-group>
    <el-menu default-active="2" class="el-menu-vertical-demo" :collapse="isCollapse" @open="handleOpen"
      @close="handleClose">
      <el-sub-menu index="1">
        <template #title>
          <el-icon>
          </el-icon>
          <span>Navigator One</span>
        </template>
        <el-menu-item-group>
          <template #title>
            <span>Group One</span>
          </template>
          <el-menu-item index="1-1">item one</el-menu-item>
          <el-menu-item index="1-2">item two</el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group title="Group Two">
          <el-menu-item index="1-3">item three</el-menu-item>
        </el-menu-item-group>
        <el-sub-menu index="1-4">
          <template #title>
            <span>item four</span>
          </template>
          <el-menu-item index="1-4-1">item one</el-menu-item>
        </el-sub-menu>
      </el-sub-menu>
      <el-menu-item index="2">
        <el-icon>
        </el-icon>
        <template #title>Navigator Two</template>
      </el-menu-item>
      <el-menu-item index="3" disabled>
        <el-icon>
        </el-icon>
        <template #title>Navigator Three</template>
      </el-menu-item>
      <el-menu-item index="4">
        <el-icon>
        </el-icon>
        <template #title>Navigator Four</template>
      </el-menu-item>
    </el-menu>

    <div class="tooltip-base-box">
      <div class="row center">
        <el-tooltip class="box-item" effect="dark" content="Top Left prompts info" placement="top-start">
          <el-button>top-start</el-button>
        </el-tooltip>
        <el-tooltip class="box-item" effect="dark" content="Top Center prompts info" placement="top">
          <el-button>top</el-button>
        </el-tooltip>
        <el-tooltip class="box-item" effect="dark" content="Top Right prompts info" placement="top-end">
          <el-button>top-end</el-button>
        </el-tooltip>
      </div>
      <div class="row">
        <el-tooltip class="box-item" effect="dark" content="Left Top prompts info" placement="left-start">
          <el-button>left-start</el-button>
        </el-tooltip>
        <el-tooltip class="box-item" effect="dark" content="Right Top prompts info" placement="right-start">
          <el-button>right-start</el-button>
        </el-tooltip>
      </div>
      <div class="row">
        <el-tooltip class="box-item" effect="dark" content="Left Center prompts info" placement="left">
          <el-button class="mt-3 mb-3">left</el-button>
        </el-tooltip>
        <el-tooltip class="box-item" effect="dark" content="Right Center prompts info" placement="right">
          <el-button>right</el-button>
        </el-tooltip>
      </div>
      <div class="row">
        <el-tooltip class="box-item" effect="dark" content="Left Bottom prompts info" placement="left-end">
          <el-button>left-end</el-button>
        </el-tooltip>
        <el-tooltip class="box-item" effect="dark" content="Right Bottom prompts info" placement="right-end">
          <el-button>right-end</el-button>
        </el-tooltip>
      </div>
      <div class="row center">
        <el-tooltip class="box-item" effect="dark" content="Bottom Left prompts info" placement="bottom-start">
          <el-button>bottom-start</el-button>
        </el-tooltip>
        <el-tooltip content="Bottom Center prompts info" placement="bottom">
          <el-button>bottom</el-button>
        </el-tooltip>
        <el-tooltip class="box-item" effect="dark" content="Bottom Right prompts info" placement="bottom-end">
          <svg-icon style="width: 1em; height: 1em; margin-right: 8px;" icon-class="search" />
        </el-tooltip>
      </div>
    </div>

    <p>{{ t('common.searchText') }}</p>

    <el-dropdown>
      <span class="el-dropdown-link">
        Dropdown List
        <el-icon class="el-icon--right">
          <svg-icon style="width: 1em; height: 1em; margin-right: 8px;" icon-class="search" />
        </el-icon>
      </span>
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item>Action 1</el-dropdown-item>
          <el-dropdown-item>Action 2</el-dropdown-item>
          <el-dropdown-item>Action 3</el-dropdown-item>
          <el-dropdown-item disabled>Action 4</el-dropdown-item>
          <el-dropdown-item divided>Action 5</el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>


    <div>
      <el-select-v2 v-model="value" :options="options" placeholder="Please select"  size="large" multiple value-key="value.id"
        style="width: 240px;" />
      <!-- <el-date-picker
        v-model="value1"
        type="datetime"
        placeholder="Pick a Date"
        format="YYYY/MM/DD hh:mm:ss"
      /> -->

    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import dayjs from 'dayjs';



const { t } = useI18n()
const value1 = ref('')
const defaultTime = new Date(2000, 1, 1, 12, 0, 0)

console.log(dayjs(defaultTime).locale('es'))

const isCollapse = ref(true)
const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}

const initials = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

const value = ref([{ id: 0 }])
const options = [{
  id: 0,
  label: '00',
  value: { id: 0 },
},
{
  id: 1,
  label: '1111',
  value: { id: 1 }
},
{
  id: 2,
  label: '2222',
  value: { id: 2 }
}]
</script>

<style>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}

.tooltip-base-box {
  width: 600px;
}

.tooltip-base-box .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tooltip-base-box .center {
  justify-content: center;
}

.tooltip-base-box .box-item {
  width: 110px;
  margin-top: 10px;
}
</style>
